UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3GIngJcCzUA96FB2Bt8wWkwHTlIRqiNpIJw8niU8ehc='
WHERE
key_id = 'f55be6deafb5a05b47f06ba2ac51ca7f2db6d8ae164626dbb16de0f9b62b222a'
AND (
token = '3GIngJcCzUA96FB2Bt8wWkwHTlIRqiNpIJw8niU8ehc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)