UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mjr5RmFw8dbPxgKVhOMeApEyet1EHefy1gQVFWylhOs='
WHERE
key_id = '098a0c90d2828291579af69cc5dc3e55e145502b43eb318fc75e7837f293c753'
AND (
token = 'mjr5RmFw8dbPxgKVhOMeApEyet1EHefy1gQVFWylhOs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)