UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oFhm/VGEBog0vvOCXAXxJcxcN6NSI3z8kYOV+kdboi4='
WHERE
key_id = 'bce5e614180b0f873c1b7bf72a3d2969e65c95c681a3d95109111241e1adec21'
AND (
token = 'oFhm/VGEBog0vvOCXAXxJcxcN6NSI3z8kYOV+kdboi4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)