UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '87SlrRyKLZoiJbkJz8V1A3E5oFz70ZgMmwtGP/32WLY='
WHERE
key_id = 'b756ab37111823ae8a588020dda82c9ef2275c697a1eb438a9c5c9f2956d28bc'
AND (
token = '87SlrRyKLZoiJbkJz8V1A3E5oFz70ZgMmwtGP/32WLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)