UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+mlEL+K8PB3CwbFucPFJ9x19kmyeT1/i73SuUua3lLo=' 
WHERE 
  key_id = '090c8b08788342b428e3ed2aed5900015a0b5f45a330f7bcd5fd92dce55e26bf' 
  AND (
    token = '+mlEL+K8PB3CwbFucPFJ9x19kmyeT1/i73SuUua3lLo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054