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