UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V914d3yinBvToJeQasPh7p+VV6ktNgflElkFwO5ccl0=' 
WHERE 
  key_id = 'f432dee35f27c080d48ac0cbcd23f1193f7af68a471f69ab3568d48543b326d2' 
  AND (
    token = 'V914d3yinBvToJeQasPh7p+VV6ktNgflElkFwO5ccl0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040