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