UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NhRs8txn5Lme8pvknSdKjjxG7FMg4Bq9gH4NMPnD998='
WHERE
key_id = 'f07e73908b52a5cf718e855302dd72acea1df380c7dc285495659f9ca8aa5c72'
AND (
token = 'NhRs8txn5Lme8pvknSdKjjxG7FMg4Bq9gH4NMPnD998='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)