UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9L1OTgiDjrz6gMiTISUyzrw3tkdIfovK3GIXS7qKrCY='
WHERE
key_id = '10ef775d1039543fd7f17cb4a67ac676b6d0f36d9e2cdfeec41ff0ca86592fe0'
AND (
token = '9L1OTgiDjrz6gMiTISUyzrw3tkdIfovK3GIXS7qKrCY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)