UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hspInTVqtHRddj8GrWXhcltYmFmR5lvVtli3Ok5dpM0='
WHERE
key_id = '245b16c5febd1d535d7d2bc49c7dba151414490ed9bb01ad18167f9e1ab6494c'
AND (
token = 'hspInTVqtHRddj8GrWXhcltYmFmR5lvVtli3Ok5dpM0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)