UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nXF0QqX3C1Os2GlYLUm/HuticYUVwl56yDjvKaOBpts='
WHERE
key_id = '157c790806eb82acd2a8c7b13fbcbe7d22abf1f45708ea37144b8d2b379c4e43'
AND (
token = 'nXF0QqX3C1Os2GlYLUm/HuticYUVwl56yDjvKaOBpts='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)