UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eK7vHqqdErC/JuV3aPk6rTVdDQk+Rip98cZKc4Wrbxg=' 
WHERE 
  key_id = '0840ceff614222ca05ba7dfd5960bfbff308d54b1efa24f727a6813738b76dd1' 
  AND (
    token = 'eK7vHqqdErC/JuV3aPk6rTVdDQk+Rip98cZKc4Wrbxg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036