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