UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iJ4JeWCCio4/RqHaIBlyZru2yc9Ol6/am0Uo0x9RZXA='
WHERE
key_id = 'f3e5a981f66406d39fbf3c5505152904676def3dadb8b47d7aaa74f5b6248e8f'
AND (
token = 'iJ4JeWCCio4/RqHaIBlyZru2yc9Ol6/am0Uo0x9RZXA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)