UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GMBVPUx93kwdqV4Qhcg7aAQXTbmdcDkGoXBQGYrZEk8='
WHERE
key_id = '921672172b8d851b9e57300248fc05aefb4759658eea2b1346fc7ca946d0d483'
AND (
token = 'GMBVPUx93kwdqV4Qhcg7aAQXTbmdcDkGoXBQGYrZEk8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)