UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2T5pTgrdp3VJCwSqxgaTnstPm7WqXqk29oMqXJq6sHg='
WHERE
key_id = 'a9990e38efb7564c60d75baf01512103d501c11e2a39845314d8e6a19dbf9e20'
AND (
token = '2T5pTgrdp3VJCwSqxgaTnstPm7WqXqk29oMqXJq6sHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)