UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C4/S3cAgnGo7oJXLftqqIFiZUmBFcKvYeyAEZey70fI='
WHERE
key_id = 'f27f0006df6889c032599853b06d3424bbe63088b1cc6e1582320451daf1c135'
AND (
token = 'C4/S3cAgnGo7oJXLftqqIFiZUmBFcKvYeyAEZey70fI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)