UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uUxCitYNgNg9ImDSs6aZcw7H2c1vBdLrWjoI+p1fhjE=' 
WHERE 
  key_id = 'f545b013969c4ce651326ccc11d6ed828e7ffb3cda39a6fb80b4809d78a000e8' 
  AND (
    token = 'uUxCitYNgNg9ImDSs6aZcw7H2c1vBdLrWjoI+p1fhjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034