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