UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j4bTgVmC97BIlXR0myRR8erIyOopHykqOFis9tU971I='
WHERE
key_id = 'aec09154861c3fc995a9cafb154249322b2e847a3c6b9bdb671bb52d0e0b9279'
AND (
token = 'j4bTgVmC97BIlXR0myRR8erIyOopHykqOFis9tU971I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)