UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uMmtY799PbyaV3v+B17xqRQTUw2skOcKtkDjKHR/f2I=' 
WHERE 
  key_id = '543afde542b9b63def8d5a55e08ce802075c6836798d41aab7387c77905b744e' 
  AND (
    token = 'uMmtY799PbyaV3v+B17xqRQTUw2skOcKtkDjKHR/f2I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036