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