UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'px9mXcE+I6i4spUWl3kh9ibkI7UA9uItIoOvMXoK1XQ=' 
WHERE 
  key_id = '98488cced44bcd75921bbb95363c1378e86420d72e8cb9ce26b434c849b615e5' 
  AND (
    token = 'px9mXcE+I6i4spUWl3kh9ibkI7UA9uItIoOvMXoK1XQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028