UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8V24WwzVnXDcEIY/zPel0aH773GYQoVejR32B3GcEIc='
WHERE
key_id = '9385fff8ff98fb4119040756a115ce69851ff67a6b0582be5d595dfe8fbe8f15'
AND (
token = '8V24WwzVnXDcEIY/zPel0aH773GYQoVejR32B3GcEIc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)