UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TNVoRkvjmjeMvfLSKKNb04aFIc3WEzCxLHatQ9uBrl8=' 
WHERE 
  key_id = '1c04ed9d62dfdc0679e0bf173b675779d3f22e5168c78e40e114f61fd576ba9c' 
  AND (
    token = 'TNVoRkvjmjeMvfLSKKNb04aFIc3WEzCxLHatQ9uBrl8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043