UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p3F+/LDFeQaCdH8KbwMnVRZTiPhN5iovrVTm4SmHxXs='
WHERE
key_id = '078fc9657b960cc8c06d8378625c6b6ca847ce4569a2b324ec199f7e6729c282'
AND (
token = 'p3F+/LDFeQaCdH8KbwMnVRZTiPhN5iovrVTm4SmHxXs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)