UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZpxXdfg84L9JaZMzdIcD/qgz7h5dEruPacSsKNQZkAY=' 
WHERE 
  key_id = '8e1e5b07fac287273d5c65ee42d6fcef1a23456bbaf15cbad902b7cb31fdb1f2' 
  AND (
    token = 'ZpxXdfg84L9JaZMzdIcD/qgz7h5dEruPacSsKNQZkAY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033