UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EH02FkjakYkAPESiW11xNK3rbMflU8tCD9uhonM+Ip8='
WHERE
key_id = '3007678c12a86ae55ffed04a1d1e4a876f8a73090e5e090217bb830f666ddaec'
AND (
token = 'EH02FkjakYkAPESiW11xNK3rbMflU8tCD9uhonM+Ip8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)