UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L9k5qcoweWk2hq+/2X+d8clwSq2d6u1SNb8vTRq4mzw=' 
WHERE 
  key_id = '6986a9dd44d57e7460ff718c26bfe16429f3867de2c6b9ceb8735a60bffbaae6' 
  AND (
    token = 'L9k5qcoweWk2hq+/2X+d8clwSq2d6u1SNb8vTRq4mzw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029