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